# 定义一个类来表示通讯录条目
class Book:
    def __init__(self, name, number, company):
        self.name = name
        self.number = number
        self.company = company

# 定义一个函数来打印通讯录条目
def print_book(student):
    print("学生姓名:", student.name)
    print("学生电话号码:", student.number)
    print("学生公司地址:", student.company)

# 创建通讯录条目对象
A = Book("胶王", "13990534192", "下北泽")
B = Book("CARRY", "19160336615", "东京湾")
C = Book("牟越", "1892938103", "东京")
D = Book("陆涛", "15884268730", "理塘")
E = Book("罗成", "11451419198", "Σ(っ °Д °;)っ")


print("以下是602宿舍的通讯录")
print("请输入1.胶王 2.CARRY 3.牟越 4.陆涛，5.罗成")
a = int(input("请输入要查看多少人: "))

# 循环打印通讯录条目
b = 1
while b <= a:
    choice = int(input(f"请输入要查看的第{b}个人的编号: "))
    if choice == 1:
        print_book(A)
    elif choice == 2:
        print_book(B)
    elif choice == 3:
        print_book(C)
    elif choice == 4:
        print_book(D)
    elif choice == 5:
        print_book(E)
    else:
        print("未找到匹配的记录")
    b += 1
